package javacore.Statements;

public class WhileLoop {

	public static void main(String[] args) {
		// Using the while loop to calculate sum
		
		int limit = 20;
	    int sum = 0;
	    int i = 1;

	    while (i <= limit) {
	      sum = sum + i;
	      i++;
	    }
	    System.out.println("sum = " + sum);

	}

}
